package com.estun.backroundManagementService.modules.repory.controller;

import com.estun.backroundManagementService.modules.repory.request.ProductDataRequest;
import com.estun.backroundManagementService.modules.repory.request.WorkOrderRequest;
import com.estun.backroundManagementService.modules.repory.service.ApiExcelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletResponse;

@Controller
@RequestMapping("/api/excel")
public class ApiExcelController {

    @Autowired
    private ApiExcelService apiExcelService;

    @GetMapping("/exportWorkOrder")
    public void exportWorkOrder(HttpServletResponse response, WorkOrderRequest workOrderRequest) {
        apiExcelService.exportExcelByCondition(response, workOrderRequest);
    }

    @GetMapping("/exportProductData")
    public void exportProductData(HttpServletResponse response, ProductDataRequest productDataRequest) {
        apiExcelService.exportExcelByCondition(response, productDataRequest);
    }

}
